{extend name="base" /}
{block name="main"}
<div class="l-loading" style="display: block" id="htr-loading"></div>
<form id='editFrom' autocomplete='off'>
<table class='htr-form htr-box-top'>
  <tr>
     <th>商品编号<font color='red'>*</font>：</th>
     <td><input type="text" id='goodsSn' class='ipt' autofocus /></td>
  </tr>
</table>
</form>
<script>
$(function(){
  $('#goodsSn').focus();
  var goodsId = 0;
  $('#goodsSn').change(function(){
    check_goods();
  });
  function check_goods(){
    var goodsSn = $('#goodsSn').val();
    if(goodsSn!=''){
      $.post(HTR.U('index/stocks/reduce'),{goodsSn:goodsSn},function(data,textStatus){
        var json = HTR.toIndexJson(data);
        if(json.status=='1'){
          HTR.msg('商品出库成功',{icon:1,time: 1000}, function(){
            location.reload();
          });
        }else{
          HTR.msg(json.msg,{icon:2});
        }
      });      
    }
  }
})
</script>
{/block}
{block name="js"}
<script src="__INDEX__/stocks/stocks.js?v={$v}" type="text/javascript"></script>
{/block}